# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import advancedExcelDirectivesConstants

class AdvancedExcelDirectivesSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(AdvancedExcelDirectivesSubDirectiveTree, self).__init__(parent)
        self.createAdvancedExcelDirectivesTreeNode()

    def createAdvancedExcelDirectivesTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "advancedExcelDirectives"
        self.setText(0,"Excel高级指令")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.runningExcelMacroDirective, "运行Excel宏")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.refreshingExcelDataDirective, "刷新Excel数据")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.settingExcelFormatDirective, "设置格式")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.clearingExcelFormatDirective, "清空格式")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.settingExcelRowHeightDirective, "设置行高")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.settingExcelColumnWidthDirective, "设置列宽")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.creatingExcelPivotTableDirective, "新建数据透视表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.refreshingExcelPivotTableDirective, "刷新数据透视表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.filteringExcelPivotTableDirective, "筛选数据透视表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.addingDataValidationDiractive, "新增数据验证")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, advancedExcelDirectivesConstants.AdvancedExcelDirectivesConstants.customExcelSortingDirective, "Excel自定义排序")
